package org.yang.order.food.api;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.yang.order.food.entity.Merchant;
import org.yang.order.food.service.FoodService;
import org.yang.order.food.service.FoodTypeService;
import org.yang.order.food.service.IndexService;
import org.yang.order.food.service.MerchantService;
import org.yang.order.food.vo.FoodVo;

import java.util.List;

/**
 * @author shichenyang
 */
@RestController
@RequestMapping("/api/v1/index")
public class WxIndexController {
    @Autowired
    private FoodService foodService;
    @Autowired
    private FoodTypeService foodTypeService;
    @Autowired
    private MerchantService merchantService;
    @Autowired
    private IndexService service;

    @GetMapping("/merchant")
    public Merchant merchant(){
       return merchantService.getById(1);
    }

    @GetMapping("/all")
    public List<FoodVo> getAll(){
        return service.indexFoods();
    }
}
